package cn.netshop.pojo.;

import com.alibaba.fastjson.JSONObject;

/**
 * tb_pref实体类
 * 
 * @author 
 *
 */
public class TbPref {
	/**ID*/
	private Integer id; 
	/**分类ID*/
	private Integer cateId; 
	/**消费金额*/
	private Integer buyMoney; 
	/**优惠金额*/
	private Integer preMoney; 
	/**活动开始日期*/
	private java.time.Instant startTime; 
	/**活动截至日期*/
	private java.time.Instant endTime; 
	/**类型*/
	private String type; 
	/**状态*/
	private String state; 
	/**
	 * 实例化
	 */
	public TbPref() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */
	public TbPref(JSONObject obj) {
		this();
		if (obj.get("id") instanceof Number) {
			this.setId(((Number) obj.get("id")).intValue());
		}
		if (obj.get("cateId") instanceof Number) {
			this.setCateId(((Number) obj.get("cateId")).intValue());
		}
		if (obj.get("buyMoney") instanceof Number) {
			this.setBuyMoney(((Number) obj.get("buyMoney")).intValue());
		}
		if (obj.get("preMoney") instanceof Number) {
			this.setPreMoney(((Number) obj.get("preMoney")).intValue());
		}
		this.setStartTime(obj.get("startTime"));
		this.setEndTime(obj.get("endTime"));
		if (obj.get("type") instanceof String) {
			this.setType((String) obj.get("type"));
		}
		if (obj.get("state") instanceof String) {
			this.setState((String) obj.get("state"));
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getCateId() != null) {
			result.put("cateId",this.getCateId());
		}
		if (this.getBuyMoney() != null) {
			result.put("buyMoney",this.getBuyMoney());
		}
		if (this.getPreMoney() != null) {
			result.put("preMoney",this.getPreMoney());
		}
		if (this.getStartTime() != null) {
			result.put("startTime",this.getStartTime());
		}
		if (this.getEndTime() != null) {
			result.put("endTime",this.getEndTime());
		}
		if (this.getType() != null) {
			result.put("type",this.getType());
		}
		if (this.getState() != null) {
			result.put("state",this.getState());
		}
		return result;
	}
	
	
	/**
	 * 获取id
	 * 
	 * @return
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * 设置id
	 * 
	 * @param id
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	
	/**
	 * 获取cateId
	 * 
	 * @return
	 */
	public Integer getCateId() {
		return cateId;
	}

	/**
	 * 设置cateId
	 * 
	 * @param cateId
	 */
	public void setCateId(Integer cateId) {
		this.cateId = cateId;
	}
	
	/**
	 * 获取buyMoney
	 * 
	 * @return
	 */
	public Integer getBuyMoney() {
		return buyMoney;
	}

	/**
	 * 设置buyMoney
	 * 
	 * @param buyMoney
	 */
	public void setBuyMoney(Integer buyMoney) {
		this.buyMoney = buyMoney;
	}
	
	/**
	 * 获取preMoney
	 * 
	 * @return
	 */
	public Integer getPreMoney() {
		return preMoney;
	}

	/**
	 * 设置preMoney
	 * 
	 * @param preMoney
	 */
	public void setPreMoney(Integer preMoney) {
		this.preMoney = preMoney;
	}
	
	/**
	 * 获取startTime
	 * 
	 * @return
	 */
	public java.time.Instant getStartTime() {
		return startTime;
	}

	/**
	 * 设置startTime
	 * 
	 * @param startTime
	 */
	public void setStartTime(java.time.Instant startTime) {
		this.startTime = startTime;
	}
	
	/**
	 * 获取endTime
	 * 
	 * @return
	 */
	public java.time.Instant getEndTime() {
		return endTime;
	}

	/**
	 * 设置endTime
	 * 
	 * @param endTime
	 */
	public void setEndTime(java.time.Instant endTime) {
		this.endTime = endTime;
	}
	
	/**
	 * 获取type
	 * 
	 * @return
	 */
	public String getType() {
		return type;
	}

	/**
	 * 设置type
	 * 
	 * @param type
	 */
	public void setType(String type) {
		this.type = type;
	}
	
	/**
	 * 获取state
	 * 
	 * @return
	 */
	public String getState() {
		return state;
	}

	/**
	 * 设置state
	 * 
	 * @param state
	 */
	public void setState(String state) {
		this.state = state;
	}

	@Override
	public String toString() {
		return "TbPref [id=" + id + " , cateId=" + cateId + " , buyMoney=" + buyMoney + " , preMoney=" + preMoney + " , startTime=" + startTime + " , endTime=" + endTime + " , type=" + type + " , state=" + state + "  ]";
	
	}
	
	
}
